export function BMPGL(ak: string) {
  return new Promise<any>((resolve, reject) => {
    window.init = function () {
      resolve(window.BMapGL);
    };
    const script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = `https://api.map.baidu.com/api?v=3.0&type=webgl&ak=${ak}&callback=init`;
    script.onerror = reject;
    document.head.appendChild(script);
  });
}
